<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<%@ taglib tagdir="/WEB-INF/tags" prefix="h" %>

<h:body title="course edit">
<form:form modelAttribute="course">


<form:errors path="*" cssClass="errors"/>
	<div class="c_block">
		<div class="title">Редактирование курса</div>
        <div class="row">
        	<div class="simple_l">Название</div>
            <div class="simple_r"><form:input path="name" size="30" maxlength="80"/></div>
        </div>
        <div class="row">
			<div class="simple_l">Дополнительно</div>
			<div><form:textarea path="info"/></div>
    	</div>
    	<div class="row">
			<div class="simple_l">Дисциплина</div>
			<div><form:select path="discipline" items="${disciplines}" itemLabel="shortName" itemValue="id"/></div>
    	</div>

		<span class="last">
			  <c:choose>
				<c:when test="${course.new}">
					<a href="<c:url value="/courseList.htm"/>">Cancel</a>
				</c:when>
				<c:otherwise>
					<a href="<c:url value="/course/${course.id}"/>">Cancel</a>
                </c:otherwise>
			</c:choose>
			<a href="#" onclick="javascript:document.forms['course'].submit();">Save</a>
		</span>
	</div>
</form:form>
</h:body>